/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entities.vo;

import java.io.Serializable;
import java.util.LinkedList;
import java.util.List;

/**
 *
 * @author Jhonny
 */
public class OFADVO implements Serializable{

	private static final long serialVersionUID = 8477228547000947306L;
	private long nroOfad;
    private long idCasaCentral;
    List<ItemOFADVO> items;

    public OFADVO() {
        items = new LinkedList<ItemOFADVO>();
    }

    public List<ItemOFADVO> getItems() {
        return items;
    }

    public void setItems(List<ItemOFADVO> items) {
        this.items = items;
    }
    public void addArticulo(ArticuloVO articulo){
        items.add(new ItemOFADVO(articulo,this));
    }

    public long getIdCasaCentral() {
        return idCasaCentral;
    }

    public void setIdCasaCentral(long idCasaCentral) {
        this.idCasaCentral = idCasaCentral;
    }

    public long getNroOfad() {
        return nroOfad;
    }

    public void setNroOfad(long nroOfad) {
        this.nroOfad = nroOfad;
    }
    
    public List<ArticuloVO> getArticulos(){
    	List<ArticuloVO> result = new LinkedList<ArticuloVO>();
    	for (ItemOFADVO itemIt : getItems()){
    		result.add(itemIt.getArticulo());
    	}
    	return result;
    }

    
}
